﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NETMovie.Entities;

namespace NETMovie.Repositories.EF
{
    public abstract class AbstractRepository : IDisposable
    {
        protected NETMovieEntitiesContainer cntx;

        protected void Initialize()
        {
            if (cntx != null)
                cntx.Dispose();

            cntx = new NETMovieEntitiesContainer();
        }

        void IDisposable.Dispose()
        {
            if (cntx != null)
            {
                cntx.Dispose();
                cntx = null;
            }
        }
    }
}
